package net.weitalk.newfeatures.returncode;

public class UseCase {
    public static void main(String[] args) {
        Returned<Digest> rt = Digest.of("SHA-256");
        if (rt instanceof Returned.ReturnValue) {
            Returned.ReturnValue rv = (Returned.ReturnValue) rt;
            Digest d = (Digest) rv.returnValue();
            d.digest("Hello world!".getBytes());
        } else {
            System.out.println("Failed to get instance of SHA-256");
        }
    }
}